<template>
    <fieldset>
        <legend>子组件</legend>
        <h1>{{ gift }}</h1>
        <h1>余额：{{ balance }}</h1>
        <button @click="bet">点击下单</button>
    </fieldset>
</template>
<script setup>
import { ref, defineProps, toRefs, defineEmits } from 'vue';
let props = defineProps(['gift'])
console.log(props);
let { gift } = toRefs(props)



//子传父的过程

let balance = ref(55555555)


let emit = defineEmits(['betMoney'])
console.log(emit);
let bet = function () {
    balance.value = balance.value - 10000
    emit('betMoney', 10000)
}
</script>